package com.abbas.CayTcore.model

import com.abbas.CayTcore.base.BaseModel
import com.abbas.CayTcore.entity.CoreLW
import com.abbas.CayTcore.entity.TCoreBase
import com.abbas.CayTcore.subscribeDbResult

class WindingModel : BaseModel() {

    fun getCore(lw: CoreLW, success: (data :List<TCoreBase>) -> Unit,failure: (e: Throwable) -> Unit) {
        db.coreDao()
            .getLWOfCore(lw.length, lw.width)
            .subscribeDbResult({
                success.invoke(it)
            }, {
                failure.invoke(it)
            })
    }
}